﻿@model MaterialPurchase
@{
    Layout = "~/Views/Shared/_LayoutFormDetail.cshtml";
}
@section Up{
    @Html.HiddenFor(model => model.Id)
    @Html.HiddenFor(model => model.OrderState)
    @Html.nbDropDownListFor(model => model.SupplierId, "Supplier").Required()
    @Html.nbDateFor(model => model.OrderDate)
}
@section Down{
    @(Html.nbFormListFor<MaterialPurchaseItem>(s =>
    {
        s.Action(@Url.Action("EditList"));
        s.ExtParam(new { OrderId = "$('#Id').val()" });
        s.layoutW(10);
        s.layoutH(130);
        s.Columns(c =>
        {
            c.Bind(m => m.Id).IsKey();
            c.Bind(m => m.MaterialId).Hide();
            c.Bind(m => m.Code).Width(50);
            c.Bind(m => m.Name).Width(70).Align(GridAlign.Left);
            c.BindEnum(m => m.Category, "MaterialCategory").Width(50);
            c.Bind(m => m.Price).Width(50).Align(GridAlign.Right);
            c.BindEnum(m => m.Unit, "MaterialUnit").Width(40);
            c.Bind(m => m.OrderCount).Width(70).Align(GridAlign.Right);
            //c.BindControl(m => m.DeliveryCount).Width(70).Align(GridAlign.Right);
            c.BindControl(m => m.StorageCount).Width(70).Align(GridAlign.Right);
        });
    }))
}
